import request from '@/utils/request.js'

/* 获取所有权限列表 */
export const getPermissionList = (params) => {
	return request({
		url: '/sys/permission',
		params,
		method: 'get'
	})
}

/* 根据ID获取权限点 */
export const getPerById = (id) => {
	return request({
		url: `/sys/permission/${id}`
	})
}

/* 新增权限点 */
export const addPermission = (data) => {
	return request({
		url: '/sys/permission',
		method: 'post',
		data
	})
}

/* 根据ID更新权限点 */
export const updatePerById = (id, data) => {
	return request({
		url: `/sys/permission/${id}`,
		method: 'put',
		data
	})
}

/* 根据ID删除权限点 */
export const removePerById = (id) => {
	return request({
		url: `/sys/permission/${id}`,
		method: 'delete'
	})
}
